bus/spectrum: Add Kempston Mouse Interface slot device#14908
bus/spectrum: Add Kempston Mouse Interface slot device#14908ajrhacker merged 5 commits intomamedev:masterfrom
Conversation
dotkoval
commented
Feb 1, 2026
- classic 2-button mouse interface
- available for classic ZX Spectrum models (48/128/+2/+3)
* classic 2-button mouse interface * available for classic ZX Spectrum models (48/128/+2/+3)
| // The right key was the primary key in most implementations in the 1980s–1990s. | ||
| PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_NAME("Mouse Button Right") PORT_CODE(MOUSECODE_BUTTON2) | ||
| PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_NAME("Mouse Button Left") PORT_CODE(MOUSECODE_BUTTON1) |
There was a problem hiding this comment.
That doesn't mean it should map arbitrarily. It's IPT_BUTTON1 / IPT_BUTTON2, numbers are relative to your device, leaving the user to assign inputs if the defaults aren't satisfactory.
There was a problem hiding this comment.
I think that mapping matches what I did before for the clones without exp slot.
I would prefer to keep them consistent and fix everywhere in one shot.
Let's not make him responsible for my mistakes.
There was a problem hiding this comment.
Makes sense! Thanks for pointing this out. I've updated it to use IPT_BUTTON1/IPT_BUTTON2. I kept the PORT_CODE(MOUSECODE_...) defaults to ensure correct 2-button behaviour, as otherwise BUTTON2 maps to the middle mouse button by default.
|
|
||
| **********************************************************************/ | ||
|
|
||
| // Original Kempston mouse interface description: |
There was a problem hiding this comment.
Move up, inside header comment
There was a problem hiding this comment.
Rgr! Fixed in the latest commit :)
* Use IPT_BUTTON1/IPT_BUTTON2 as logical device buttons * Override default host mapping to ensure correct 2-button behavior
| @@ -0,0 +1,107 @@ | |||
| // license:BSD-3-Clause | |||
| // copyright-holders: Oleksandr Kovalchuk | |||
| // Thanks to: Nigel Barnes (based on kempjoy implementation) | |||
There was a problem hiding this comment.
No need for the Thanks, it's a very common device template.
There was a problem hiding this comment.
Just to check - should I remove the "Thanks" line?
I think expressing appreciation is never a bad thing :) but if it doesn't match the usual template or project rules, I'll gladly remove it.
There was a problem hiding this comment.
Yes, remove, it's thanking me though I haven't contributed to this file.
|
|
||
|
|
||
| //------------------------------------------------- | ||
| // input_ports - device-specific input ports |
There was a problem hiding this comment.
I think we don't like these mumbling comments anymore. Anybody confirm?
There was a problem hiding this comment.
I personally don't see the point to them
There was a problem hiding this comment.
Cleaned up the comments according to your suggestions.
| //------------------------------------------------- | ||
|
|
||
| static INPUT_PORTS_START( kempmouse ) | ||
| PORT_START("mouse_x") /* 0xFBDF */ |
There was a problem hiding this comment.
...and block comments for single line